import random
from datetime import datetime


def randomGen(place):
    base = "qwertyuioplkjhgfdsazxcvbnmQAZWSXEDCRFVTGBYHNUJMIKLOP0123456789"
    return ''.join(random.choice(base) for _ in range(place))


def format_current_date(format_str="%Y%m%d"):
    now = datetime.now()
    return now.strftime(format_str)


def genCode(prefix, place=6):
    return prefix + format_current_date() + randomGen(place)


if __name__ == '__main__':
    print(randomGen(5))
    print(format_current_date())
    print(genCode("U"))
